package org.example.gxpt.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.gxpt.pojo.dto.InstrumentPageQueryDTO;
import org.example.gxpt.pojo.entity.Instrument;
import org.example.gxpt.pojo.vo.InstrumentQueryVO;

import java.util.List;

@Mapper
public interface InstrumentMapper {

    @Select("select i.*, s.name showroomName from instruments i left join gxpt.showroom s on s.id = i.showroom_id")
    List<InstrumentQueryVO> listAll();

    Page<InstrumentQueryVO> pageQuery(InstrumentPageQueryDTO instrumentPageQueryDTO);

    @Select("select i.*, s.name showroomName from instruments i left join gxpt.showroom s on s.id = i.showroom_id where i.id = #{id}")
    InstrumentQueryVO getById(Long id);
}
